/*package com.utils.spring;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.kyhd.cpa.dao.model.Bill;
import com.kyhd.novel.dao.model.Fiction;

public class Dao {
	@Repository
	public interface FictionRepository extends JpaRepository<Fiction, Long>,JpaSpecificationExecutor<Fiction> {

	@Query(value = "select t1.name as cityName,t2.name as hotelName\n" +
	        "from t_city t1\n" +
	        "  left join t_hotel t2 on t2.city = t1.id\n" +
	        "where t2.name = :name",
	        countQuery = "select count(*)" +
	                "from t_city t1 \n" +
	                "  left join t_hotel t2 on t2.city = t1.id\n" +
	                "where t2.name = :name"
	        , nativeQuery = true)
	Page<Object[]> findCityAndHotel(@Param("name") String name, Pageable pageable);

	@Query(value = "select new map(t1,t2) from  TCity t1 left  join THotel t2 on t1.id=t2.city where t2.name =:name")
	List<Map<String, Object>> findCityAndHotelByHQL(@Param("name") String name);

	@Query(value = "select new pers.zpw.domain.CityHohel(t1.name AS cityName,t2.name AS hotelName) from  TCity t1 left  join THotel t2 on t1.id=t2.city where t2.name =:name",
        countQuery = "select count(*) from  TCity t1 left  join THotel t2 on t1.id=t2.city where t2.name =:name")
	Page<CityHohel> findCityAndHotelAllSelf(@Param("name") String name, Pageable pageable);


    @Query(nativeQuery = true, value = "select DISTINCT v.id,v.title,v.count,case when vu.user_id is null then 'false' else 'true' end as flag from table1 v left join table2 vu on v.id = vu.vote_id and vu.user_id=:user order by v.id desc")
    public List<Object> findVoteList(@Param("user") Integer user);

	@Query(value= "select count(id) num from contract where contract_type=?2 and DATE_FORMAT(createTime,'%Y')=?1",nativeQuery=true)
	public Object getNumByYear(String year, int contractType);
    
    @Transactional
    @Modifying
    @Query(value="update customer_product_price  set disable = ?1 where id in (?2)", nativeQuery = true)
    int bulkUpdateDisableByIds( Boolean disable,List<Long> ids);

	@Query(value="select depart_type, CONCAT(depart_name,'-',platform_name) suit_platform from const_depart_platform where depart_type=?1 and deleted=0 order by depart_type,id",nativeQuery=true)
	public List<Object[]> getByDepartType(Integer departType);
	
	@Transactional
	@Query(value="select * from fiction where title in (:titles) and parentid=0",nativeQuery=true )
	List<Fiction> getByTitles(@Param("titles") List<String> titles);
	
	
	@Query(value= "select * from bill b where bill_no in (?1) and deleted = 0 and start_dt <= ?2 and end_dt >= ?2",nativeQuery=true)
	public List<Bill> queryBillBetweenDatetime(List<String> billNo,String dt);
}
*/